<template>
    <div>
        <a-dropdown>
            <a class="ant-dropdown-link" @click="e => e.preventDefault()" style="font-size:15px">
                {{ $t("lang") }}
                <a-icon type="down" />
            </a>
            <a-menu slot="overlay">
                <a-menu-item @click="change('zh')">
                    <a href="javascript:;">zh 简体中文</a>
                </a-menu-item>
                <a-menu-item @click="change('en')">
                    <a href="javascript:;">en English</a>
                </a-menu-item>
            </a-menu>
        </a-dropdown>
    </div>
</template>

<script>
export default {
    methods: {
        change(name) {
            this.$i18n.locale = name
            this.$store.dispatch('SetLang', name)
        }
    }
}
</script>